<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'show.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
	  function del(){
	     if(confirm("Are you sure? This can not be roll-back!")){
	       return true;
	     }else{
	     return false;
	     }
	  
	  }
	
	</script>

  </head>
  
  <body>

<center>
   <h1>show users</h1>
<table border="1" width="80%">
   <tr><td>序号</td><td>姓</td><td>名</td><td>年龄</td><td>更新</td><td>删除</td></tr>

   <s:iterator value="#request.list" id="user">
      <tr><td>
      <s:property value="#user.id"/>
      </td>
      
      <td>
      <s:property value="#user.firstname"/>
      </td>
      
       <td>
      <s:property value="#user.lastname"/>
      </td>
      
       <td>
      <s:property value="#user.age"/>
      </td>
      
       <td>
        <s:a href="beforeUpdate?user.id=%{#user.id}"> 更新</s:a>
      </td>
      
       <td>
        <s:a href="deleteUser?user.id=%{#user.id}" onclick="return del();">删除</s:a>
      </td>
   
   
   </s:iterator>
    

</table>

</center>
  </body>
</html>
